package net.wanho.customerManage.dao.impl;

import net.wanho.commons.dao.impl.BaseDAOImpl;
import net.wanho.commons.exception.DAOException;
import net.wanho.commons.exception.DataAccessException;
import net.wanho.customerManage.dao.WorkingFieldDAO;
import net.wanho.customerManage.po.WorkingField;

import java.util.List;

public class WorkingFieldDAOImpl extends BaseDAOImpl<WorkingField> implements WorkingFieldDAO {
    @Override
    public List<WorkingField> selectAll() throws DAOException {
        try {
            String sql = "SELECT\n" +
                    "  FIELD_ID      fieldId,\n" +
                    "  FIELD_NAME    fieldName\n" +
                    "FROM working_field";
            Object[] params = {};
            return super.queryForList(sql, params);
        } catch (DataAccessException e) {
            e.printStackTrace();
            throw new DAOException(e.getMessage());
        }
    }
}
